package sgd.tp2.api.cdr;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class CDRHandlerJSON implements ICDRHandler {

	public static String getJSONFromCDR(CDR record) {
		Gson gson = new GsonBuilder().setPrettyPrinting().create();
		return gson.toJson(record);
	}
	
	public static CDR getCDRFromJSON(String json) {
		return (CDR)(new Gson().fromJson(json, CDR.class));
	}
}
